package com.team.service.impl;

import com.team.entity.AppCategory;
import com.team.entity.AppCategoryExample;
import com.team.mapper.AppCategoryMapper;
import com.team.service.AppCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AppCategoryImpl implements AppCategoryService {
    @Autowired
    private AppCategoryMapper appCategoryMapper;
    @Override
    public List<AppCategory> getCategoryByParent(Long parentid) {
        AppCategoryExample appCategoryExample = new AppCategoryExample();
        AppCategoryExample.Criteria criteria = appCategoryExample.createCriteria();

        if (parentid==null)
          criteria.andParentidIsNull();
        else
            criteria.andParentidEqualTo(parentid);

        return appCategoryMapper.selectByExample(appCategoryExample);
    }
}
